"use client";

import React from "react";
import { useCookies } from "next-client-cookies";
import { useRouter } from "next/navigation";

export default function LoginForm() {
  const cookies = useCookies();
  const rotuer = useRouter();

  const login = async () => {
    cookies.set("username", "foobar");
    rotuer.push("/");
  };
  return (
    <div>
      <button onClick={login} className="border px-3 py-1">
        登录
      </button>
    </div>
  );
}
